﻿'' Uncomment class below to use it. Be sure to comment it again before
'' checking in and removing all calls to it from your code

''Namespace Performance
''    Public Class Profiler
''        Private Shared mFirstTimeStamp As Long
''        Private Shared mLastTimeStamp As Long
''        Private Shared mTotalWaste As Long
''        Public Shared Sub Start(ByVal checkPointName As String)
''            Debug.WriteLine("Total Last  : " & checkPointName & ": Performace profiling started")
''            mTotalWaste = 0
''            mFirstTimeStamp = Counter.GetPerfCounter
''            mLastTimeStamp = mFirstTimeStamp
''        End Sub
''        Public Shared Sub PassedCheckPoint(ByVal checkPointName As String)
''            Dim lTime As Long = Counter.GetPerfCounter
''            Dim iTotal As Integer = Counter.GetTime(mFirstTimeStamp + mTotalWaste, lTime)
''            Dim iSinceLast As Integer = Counter.GetTime(mLastTimeStamp, lTime)
''            Dim sInfo As String = String.Format("{0,5} {1,5} : {2} : Checkpoint passed", iTotal, iSinceLast, checkPointName)
''            Debug.WriteLine(sInfo)
''            mLastTimeStamp = Counter.GetPerfCounter
''            mTotalWaste += mLastTimeStamp - lTime
''        End Sub
''    End Class
''End Namespace